﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace jnxc.Web.ecshop
{
    public partial class companylist : System.Web.UI.Page
    {
        BLL.factoryinfo bll = new BLL.factoryinfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
                int totalOrders = 0;             
                totalOrders = bll.GetRecordCount("");                
                AspNetPager1.RecordCount = totalOrders;
                bindData();
            }

        }
        void bindData()
        {
            string t = "";
            if (!string.IsNullOrEmpty(Request.QueryString["t"]))
            {
                t = Request.QueryString["t"].ToString();
            }
            string sql = " fstate=1 ";
            if (t == "1") sql += " and ftype='物理防治'";
            else if (t == "2") sql += " and ftype='生物防治'";
            else if (t == "3") sql += " and ftype='化学防治'";
            
           
            rptl.DataSource = bll.GetListByPage(sql, "fid", AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
          
            rptl.DataBind();
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            bindData();
        }
    }
}